#ifndef __DYMAMIC_TREE_H__
#define __DYMAMIC_TREE_H__

namespace Trees 
{
	
	/*********************************************************************
	 *
	 *             D Y N A M I C     T R E E 
	 *
	 ********************************************************************/

	template <class V, class E>
	class DynamicTree
	{
	public:
		DynamicTree(const V& value);
		virtual ~DynamicTree();
		virtual const V Value() const;
		virtual DynamicTree<V,E>* Parent() const = 0;
		virtual DynamicTree<V,E>* Root() const = 0;
		virtual const E Cost() const = 0;
		virtual DynamicTree<V,E>* MinCost() const = 0;
		virtual void Update(const E& x) = 0;
		virtual void Link(DynamicTree<V,E>* otherRoot, const E& x) = 0;
		virtual const E Cut() = 0;
		virtual void Evert() = 0;
		
	private:
		V m_value;
	};

	/*********************************************************************
	 *
	 *             T R E E    A L L O C A T O R
	 *
	 ********************************************************************/
	template <class V, class E>
	class TreeAllocator
	{
	public:
		virtual DynamicTree<V,E>* CreateTree(const V& value) const = 0;
	};
}
#endif
